
#include "checker.h"

void Checker::ApplyTexture(Color &objColor, Vector3D v)
{
	Vector3D texVec = v*scale;

	int ix=(int)(texVec.x<0 ? 1-texVec.x: texVec.x);
	int iy=(int)(texVec.y<0 ? 1-texVec.y: texVec.y);
	int iz=(int)(texVec.z<0 ? 1-texVec.z: texVec.z);

	if ((ix+iy+iz)&1) objColor = firstColor;
	else objColor=secondColor;

}
